import request from '@/utils/request'

const api_name = '/video'

export default {

  save(video) {
    return request({
      url: `${api_name}/save`,
      headers:{
        isToken:true
      },
      method: 'post',
      data: video
    })
  },

  getById(id) {
    return request({
      url: `${api_name}/get/${id}`,
      headers:{
        isToken:true
      },
      method: 'get'
    })
  },

  updateById(video) {
    return request({
      url: `${api_name}/update`,
      headers:{
        isToken:true
      },
      method: 'put',
      data: video
    })
  },

  removeById(id) {
    return request({
      url: `${api_name}/remove/${id}`,
      headers:{
        isToken:true
      },
      method: 'delete'
    })
  }
}

export function getVideo1(currentPage,pageSize,form1){
  return request({
    url: `${api_name}/${currentPage}/${pageSize}`,
    method: 'get',
    headers:{
      isToken:true
    },
    params: form1
  })
}

export function deleteVideo(id){
  return request({
    url: `${api_name}/${id}`,
    headers:{
      isToken:true
    },
    method: 'delete'
  })
}

